﻿CREATE procedure [dbo].[_import_f1to3]
as

--DECLARE  CurTableList CURSOR  FOR 
--SELECT     hName, mgrid, hCode
--FROM         OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\Projects\TIMS\Tims200805\NSI_TBS\TBL_SECTOR.xls', 'SELECT * FROM [f3$]') 
--                      AS a
--
--OPEN CurTableList 
--DECLARE  @hName nvarchar(500), @mgrid int, @hCode varchar(2)
--FETCH NEXT FROM CurTableList INTO @hName , @mgrid, @hCode
--
--table_loop:
--	   IF (@@FETCH_STATUS <> -2)
--
--INSERT INTO dtFBK
--                      (hName, mgrid, hCode)
--VALUES (@hName , @mgrid, case len(@hCode) when 1 then '0'+@hCode else @hCode end)
--
--		FETCH NEXT FROM CurTableList INTO @hName , @mgrid, @hCode
--	IF (@@FETCH_STATUS <> -1) GOTO table_loop
--
--	CLOSE CurTableList
--	DEALLOCATE CurTableList
--/*
--UPDATE    dtFBK
--SET              hCode = hCode
--*/


